<template>
	<view>
		<fa-navbar title="编辑详情"></fa-navbar>
		<scroll-view class="pb-6" scroll-y="true">
			<view v-if="OprTime">
				<u-gap height="40" bg-color="#F6F8FB"></u-gap>
				<view class="pl-1">
					<!--<view class="flex-start height-80 h3-font">
				<view class="m-col6">操作员</view>
				<view>张晓</view>
			</view>
			<u-gap height="1" bg-color="#F6F8FB"></u-gap>-->
					<view class="flex-start height-80 h3-font">
						<view class="m-col6">操作时间</view>
						<view>{{OprTime}}</view>
					</view>
				</view>
			</view>
			<view v-if="NewName">
				<u-gap height="40" bg-color="#F6F8FB"></u-gap>
				<view class="pl-1 mb-1">
					<view class="h1-font  mt-m24">名称</view>
					<view class="flex-start-left mt-30">
						<view class="m-col6 h3-font-light-gray">原名称</view>
						<view class="h3-font-light-gray">{{OldName}}</view>
					</view>
					<view class="flex-start-left mt-30">
						<view class="m-col6 h3-font">变更名称</view>
						<view class="h3-font">{{NewName}}</view>
					</view>
				</view>
			</view>

			<view v-if="NewType">
				<u-gap height="40" bg-color="#F6F8FB"></u-gap>
				<view class="pl-1 mb-1">
					<view class="h1-font  mt-m24">类型</view>
					<view class="flex-start-left mt-30">
						<view class="m-col6 h3-font-light-gray">原类型</view>
						<view class="h3-font-light-gray">{{OldDescribe}}</view>
					</view>
					<view class="flex-start-left mt-30">
						<view class="m-col6 h3-font">变更名称</view>
						<view class="h3-font">{{OldDescribe}}</view>
					</view>
				</view>
			</view>

			<view v-if="ImgDescribe">
				<u-gap height="40" bg-color="#F6F8FB"></u-gap>
				<view class="pl-1 mb-1">
					<view class="h1-font  mt-m24">图片</view>
					<view class="m-col6 h3-font mt-m24">图片已变更</view>
				</view>
			</view>
			<view v-if="NewDescribe">
				<u-gap height="40" bg-color="#F6F8FB"></u-gap>
				<view view class="pl-1">
					<view class="h1-font  mt-m24">描述</view>
					<view class="pr-1">
						<view class="flex-between mt-2">
							<text class="m-col6 h3-font-light-gray">原描述</text>
							<text class="m-col18 h3-font-light-gray">{{OldType}}</text>
						</view>
						<view class="flex-between mt-2 mb-2">
							<text class="m-col6 h3-font">变更描述</text>
							<text class="m-col18 h3-font">{{NewType}}</text>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import faNavbar from '@/components/fa-navbar/fa-navbar.vue'
	import SOtime from '@/js_sdk/fl-SOtime/SOtime.js'

	export default {
		components: {
			faNavbar
		},
		data() {
			return {
				Guid: undefined,
				ImgDescribe: undefined,
				NewDescribe: undefined,
				NewName: undefined,
				NewType: undefined,
				OldDescribe: undefined,
				OldName: undefined,
				OldType: undefined,
				Guid: undefined,
				OprTime: undefined
			}
		},
		onLoad(options) {
			console.log(options)
			this.getEditLogDetail(options.guid)
		},

		methods: {
			// 获取编辑日志
			getEditLogDetail(guid) {
				let params = {
					ID: guid
				}
				this.$api.getOperationDetail(params)
					.then(res => {
						console.log(res)
						if (res.code === 0) {
							this.Guid = res.data.Guid
							this.ImgDescribe = res.data.ImgDescribe
							this.NewDescribe = res.data.NewDescribe
							this.NewName = res.data.NewName
							this.NewType = res.data.NewType
							this.OldDescribe = res.data.OldDescribe
							this.OldName = res.data.OldName
							this.OldType = res.data.OldType

							if (res.data.OprTime !== 0) {
								this.OprTime = SOtime.time3(res.data.OprTime)
							}
						}
					})
					.catch(err => console.error(err));
			},
		}
	}
</script>

<style lang="scss">
</style>
